 <meta charset="utf-8">
 <div class="box" id="biz_salariedStaff_conatainer">
            <div class="box-header with-border">
               <form id="searchForm" role="form" class="form-inline">
                    <div class="form-group">
                         <label>姓名</label>
                         <input name="name" v-model="searchForm.name"   type="text" placeholder="" class="form-control">
                    </div>
                      <div class="form-group">
                         <label>电话</label>
                         <input name="phone" v-model="searchForm.phone"   type="text" placeholder="" class="form-control">
                    </div>
                     <button type="button"  class="btn btn-info pull-right m-t-n-xs" v-kperms="{perm:'authRole:loadAuthRoleList'}"  v-on:click="search();"><strong>查询</strong></button>
                </form>
            </div>
 <div class="box-body">
 	                           <div class="btn-group " id="salariedStaffBTableToolbar" role="group">
 	                           		<button type="button" v-kperms="{perm:'authRole:addRole'}"  class="btn btn-default" v-on:click="add">
                                        <i class="glyphicon glyphicon-plus" aria-hidden="true"></i> 添加
                                    </button>
                                     <button type="button"  v-kperms="{perm:'authRole:updateRole'}" class="btn btn-default" v-on:click="edit">
                                        <i class="glyphicon glyphicon-pencil" aria-hidden="true"></i> 修改
                                    </button>
                                     <button type="button"  v-kperms="{perm:'authRole:setAuthRoleEnabled'}" class="btn btn-default" v-on:click="setEnable">
                                        <i class="glyphicon glyphicon-ok" aria-hidden="true"></i> 启用
                                    </button>
                                     <button type="button"  v-kperms="{perm:'authRole:setAuthRoleEnabled'}" class="btn btn-default" v-on:click="setDisable">
                                        <i class="glyphicon glyphicon-remove" aria-hidden="true"></i> 禁用
                                    </button>
                                       <button type="button"  v-kperms="{perm:'authRole:deletAuthRole'}" class="btn btn-default" v-on:click="deletex">
                                        <i class="glyphicon glyphicon-trash" aria-hidden="true"></i> 删除
                                    </button>
                           </div>
                                
           <table id="salariedStaffBTable" data-mobile-responsive="true" ></table>
 </div>
 </div>

<script> 
new Vue({  
	  el: '#biz_salariedStaff_conatainer',  
	  data:{
		  searchForm:{
			  name: null,
			  phone: null,
		  },
		  bus:new Vue(),
	  },
	  mounted:function(){
		 let _this=this;
		 _this.initTable();
	  },
  methods: {
	  initTable:function(){
		  let columns=[
				{checkbox:true},
				{field:'name',title:'授薪人员姓名',width:160,sortable:true},
				{field:'phone',title:'授薪人员电话',width:160,sortable:true},
				{field:'enabled',title:'授薪人员状态',width:100,formatter:zfesUtil.formatEnabled},
				{field:'remark',title:'备注描述',width:300}];
		  let url="tcms/salariedStaff/loadSalariedStaffDataSet";
  		zfesBstable.laodTable($("#salariedStaffBTable"),$("#searchForm"),$("#salariedStaffBTableToolbar"),url,columns,this.searchForm);
	  },
	  search:function(){
		  zfesBstable.reload($("#salariedStaffBTable")); 
	  },
	  refresh:function(){
		  zfesBstable.refresh($("#salariedStaffBTable"));
	  },
	  add:function(){
		  let　_this=this;
		 var url="/view/tcms/salariedStaff/salariedStaff.add.html";
		 zfesLayerEditDg.open(url,{},"授薪人员信息编辑",460,function(){_this.refresh();});
		 
	  },
	  edit:function(){
		  if(zfesBstable.isOneRow($("#salariedStaffBTable"))){
			  let　_this=this;
			  let id=zfesBstable.getRowId($("#salariedStaffBTable"));
			  var url="/view/tcms/salariedStaff/salariedStaff.edit.html";
			  zfesLayerEditDg.open(url,{"id":id},"授薪人员信息编辑",460,function(){_this.refresh();}); 
		 }
	  },
	  setEnable:function(){
		  if(zfesBstable.isSelectedRow($("#salariedStaffBTable"))){
			  let ids=zfesBstable.getRowIds($("#salariedStaffBTable"));
			  let　_this=this;
				 alertSwal.confirm("启用","是否执行该操作",function(){
						    let ajaxUrl = "tcms/salariedStaff/setSalariedStaffEnabled";
						    zfesAjax.ajaxTodo(ajaxUrl, { "ids" : ids,"enabled":true}, function(data) {
								alertSwal.successText(data.message);
								_this.refresh();
							});
						});
		  }
	  },
	  setDisable:function(){
		  if(zfesBstable.isSelectedRow($("#salariedStaffBTable"))){
			  let ids=zfesBstable.getRowIds($("#salariedStaffBTable"));
			  let　_this=this;
				 alertSwal.confirm("禁用","是否执行该操作",function(){
						    let ajaxUrl = "tcms/salariedStaff/setSalariedStaffEnabled";
						    zfesAjax.ajaxTodo(ajaxUrl, {"ids" : ids,"enabled":false}, function(data) {
								alertSwal.successText(data.message);
								_this.refresh();
						});
		  		});
		  }
	  },
	  deletex:function(){
			if(zfesBstable.isOneRow($("#salariedStaffBTable"))){
				  let　_this=this;
					var id=zfesBstable.getRowId($("#salariedStaffBTable"));
					 alertSwal.confirm("删除","是否执行该操作",function(){
						    let ajaxUrl = "tcms/salariedStaff/deletSalariedStaff";
							zfesAjax.ajaxTodo(ajaxUrl, { "id" : id}, function(data) {
								alertSwal.successText(data.message);
								_this.refresh();
							},function(data){
								
							}); 
				});
			}
				
	  }
 }

});
</script>


